<?php

/**
 *
 *
 * @version $Id$
 * @copyright 2010
 */

$user =	$_POST['user'];
$pass = $_POST['pass'];
$loginStatus = 'fail';

try {



	/*** connect to SQLite database ***/
	$dbh = new PDO("sqlite:AS3ProjectDatabase.s3db");

	$count= "SELECT COUNT(*) FROM Login WHERE userId = '$user' and userPassword = '$pass' ";
	$res = $dbh->query($count);

if   ($res->fetchColumn() == 1)
{
		//$correctLogin = True;
		$loginStatus = 'success';
	echo $loginStatus;
	print("loginStatus = success");


	} else {
		//$correctLogin = FALSE;
		print("loginStatus= fail");



	}



}
catch(PDOException $e)
{
	echo $e->getMessage();
}



?>
